﻿<div class="top-row ps-3 navbar navbar-dark">
    <div class="container-fluid">
        <a class="navbar-brand" href="">Blazor100</a>
        <button title="Navigation menu" class="navbar-toggler" @onclick="ToggleNavMenu">
            <span class="navbar-toggler-icon"></span>
        </button>
    </div>
</div>

<div class="@NavMenuCssClass" @onclick="ToggleNavMenu">
    <nav class="flex-column">
        <div class="nav-item px-3">
            <NavLink class="nav-link" href="" Match="NavLinkMatch.All">
                Home
            </NavLink>
        </div>
        <div class="nav-item px-3">
            <NavLink class="nav-link" href="viewer">
                图片浏览
            </NavLink>
        </div>
        <div class="nav-item px-3">
            <NavLink class="nav-link" href="handwritten">
                手写签名
            </NavLink>
        </div>
        <div class="nav-item px-3">
            <NavLink class="nav-link" href="signaturepad">
                手写签名2
            </NavLink>
        </div>
        <div class="nav-item px-3">
            <NavLink class="nav-link" href="barcodescanner">
                条码扫描
            </NavLink>
        </div>
        <div class="nav-item px-3">
            <NavLink class="nav-link" href="maps">
                谷歌地图
            </NavLink>
        </div>
        <div class="nav-item px-3">
            <NavLink class="nav-link" href="baidumap">
                百度地图
            </NavLink>
        </div>
        <div class="nav-item px-3">
            <NavLink class="nav-link" href="geolocations">
                定位
            </NavLink>
        </div>
        <div class="nav-item px-3">
            <NavLink class="nav-link" href="onscreenkeyboards">
                屏幕键盘
            </NavLink>
        </div>
        <div class="nav-item px-3">
            <NavLink class="nav-link" href="counter">
                Counter
            </NavLink>
        </div>
        <div class="nav-item px-3">
            <NavLink class="nav-link" href="fetchdata">
                Fetch data
            </NavLink>
        </div>
    </nav>
</div>

@code {
    private bool collapseNavMenu = true;

    private string? NavMenuCssClass => collapseNavMenu ? "collapse" : null;

    private void ToggleNavMenu()
    {
        collapseNavMenu = !collapseNavMenu;
    }
}
